﻿"use strict"

const fetch = require('./fetch')
const mysql = require('mysql2/promise')
const notify = require('./notify.js')
const store = require('./store/redis.js')

//console time 
const begin = tag => 
    _ => {
        console.time(tag)
        return _
    }
const end = tag => 
    _ => {
        console.timeEnd(tag)
        return _
    }
const end_begin = (tag, tag_begin) =>
_ => {
    console.timeEnd(tag)
    console.time(tag_begin)
    return _
}



console.time('fetch')
fetch()
    .then(end_begin('fetch', 'query'))
    .then(store)
    .then(end('query'))
    .catch(console.error)
